home *** CD-ROM | disk | FTP | other *** search
/ Apple Service Source 1996 February / Service Source 2.0 1996 Companion.iso / AppleOrder / Program / AppleOrder CCL Folder / AppleOrder Express Modem.CCL < prev    next >
Encoding:
Text File  |  1993-03-22  |  20.3 KB  |  659 lines  |  [TEXT/MPS ]

  1. !================================================================
  2. !    AppleOrder Express Modem.CCL
  3. !================================================================
  4. !
  5. ! USA modem CCL script for the Apple Express Modem
  6. !
  7. !    Change History-
  8. !        v1.0        09/21/90    gs:General Release Version
  9. !        v1.0.2        12/07/90    gs:Added bug fix for Printer Port ~MPRT selection
  10. !        v1.0.2        01/30/91    gs:Changed \N3 to \N2 reliable only connection
  11. !        v2.0d1        12/3/91        gs:Supports ModemCmd and ConnectStr parameters
  12. !        v2.0        9/7/92        gs:General Release Version
  13. !                    10/21/92    gs:Changed Label 80 code so that it tries at least 4 times to
  14. !                                sync up in Requesting Network attention before resetting modem.
  15. !        v2.0.1        3/5/93        gs:Changed "CARRIER" to "NO CARRIER", cleaned up CCL
  16. !                                and other miscellaneous changes
  17. !        v2.0.2        3/22/93        gs:Use Serial Tool because Express Modem tool not working
  18. !
  19. !    The following label ranges (0-255) are defined for all scripts:
  20. !
  21. !    Label        Function
  22. !    -----        --------
  23. !    0-19        Communications Setup
  24. !    20-39        Get a Modem
  25. !    40-59        Modem Setup
  26. !    60-79        Dialing
  27. !    80-99        Physical Connection
  28. !    100-119        GEIS Logon
  29. !    120-139        CICS
  30. !    140-159        APPM
  31. !    160-179        Online
  32. !    180-199        Terminate Session
  33. !    200-209        Cancel
  34. !    210-219        Hangup
  35. !    230-239        <UNUSED>
  36. !    240-255        Disconnect
  37. !
  38. !    Note:        Label 210 is the modem hangup sequence
  39. !                Label 240 is reserved as the start of the disconnect sequence
  40. !
  41. !================================================================================
  42. -LABEL 0    !***<Physical connection entry point>*** Initialize Communications
  43. !================================================================================
  44. !
  45. !    Make sure the CTB is closed first
  46. !    CTBCLOSE [<LabelIfOpenFails>] [<LabelIfError>]
  47. CTBClose 12 13
  48. !
  49. !    CTBTOOL <Toolname> [<LabelIfToolDoesn'tExist>] [<LabelIfError>] [<ctb flags>] [<buffer sizes>]
  50. !CTBTool "Express Modem Tool" 4 5
  51. !
  52. !    CTBPARAMETER <ParameterName> <NewValue> [<LabelIfError>]
  53. !CTBParameter ModemMode DataUser 6
  54. !CTBParameter Protocol V42_MNP 6
  55. !CTBParameter TypeOfCall DirectATCommands 6
  56. !CTBParameter Parity None 6
  57. !CTBParameter DataBits 8 6
  58. !CTBParameter StopBits 1 6
  59. !CTBParameter Handshake XON/XOFF 6
  60.  
  61. !    until the problem using the Express Modem Tool is fixed, must use SerialTool
  62. CTBParameter Port "Internal Modem" 6
  63. CTBParameter Baud ~Baud 6
  64. !
  65. DsplyMsg Opening the connection...
  66. !
  67. !    CTBOPEN [<LabelIfOpenFails>] [<LabelIfError>]
  68. CTBOpen 14 15        ! Open the Communications session
  69. !
  70. !    Flush any data, Initialize script variables and define Cancel label
  71. Flush                ! clear input buffer and ring buffer
  72. CanBtn 200            ! If user cancels, take the error return
  73. !
  74. SetVar 1 0            ! #of consecutive no responses to hangup command
  75. SetVar 2 0            ! #of consecutive no responses to modem configuration command
  76. SetVar 3 0            ! #of consecutive network contact failures.
  77. SetVar 4 0            ! #of logon validation failures
  78. SetVar 5 0            ! #of consecutive CICS90  failures
  79. SetVar 6 0            ! #of consecutive APPM failures
  80. SetVar 7 0            ! flag to indicate if connecting(0) or disconnecting(1)
  81. SetVar 8 0            ! not used
  82. !
  83. Jump 40                ! Go to Modem Selection and Setup
  84. !
  85. !*********
  86. -LABEL 4    !---<Express Modem Tool missing>---
  87. !*********
  88. Alert -1 The Express Modem tool cannot be found in your System folder.\13Please install it, and try again.
  89. Exit -1                ! exit the script with an error
  90. !
  91. !*********
  92. -LABEL 5    !---<CTBTool Comm Toolbox err>---
  93. !*********
  94. Alert -1 A CTBTool error has occurred in the Communications Toolbox.\13Please try again.\13If the problem continues, call the Apple USA helpline.
  95. Exit -1                ! exit the script with an error.
  96. !
  97. !*********
  98. -LABEL 6    !---<CTBParameter failed>---
  99. !*********
  100. Alert -1 Express Modem CTBParameter message caused an error.
  101. Exit -1                ! exit the script with an error.
  102. !
  103. !*********
  104. -LABEL 12    !---<CTBClose failed>---
  105. !*********
  106. Alert -1 CTBClose could not close communications.\13The serial port may already be in use.
  107. Exit -1                ! exit the script with an error.
  108. !
  109. !**********
  110. -LABEL 13    !---<CTBClose err>---
  111. !**********
  112. Alert -1 CTBClose caused a Communications Toolbox error.
  113. Exit -1                ! exit the script with an error.
  114. !
  115. !*********
  116. -LABEL 14    !---<CTBOpen failed>---
  117. !*********
  118. Alert -1 CTBOpen could not open communications.\13The serial port may already be in use.
  119. Exit -1                ! exit the script with an error.
  120. !
  121. !**********
  122. -LABEL 15    !---<CTBOpen err>---
  123. !**********
  124. Alert -1 CTBOpen caused a Communications Toolbox error.
  125. Exit -1                ! exit the script with an error.
  126. !
  127. !================================================================================
  128. -LABEL 40    !***<Modem Setup>*** Modem Reset and Setup
  129. !================================================================================
  130. DsplyPic 1
  131. DsplyMsg Making sure the modem is ready...
  132. Jsr 210                ! Hang up (just in case)
  133. SetVar 1 0            ! clear # hangup tries counter
  134. !
  135. DsplyMsg Resetting the Express Modem…
  136. MatchStr 1 42 OK
  137. Xmit AT&F\13
  138. Wait 300
  139. !
  140. !**********
  141. -LABEL 42    ! ---<Got modem attention>---
  142. !**********
  143. DsplyMsg Setting modem parameters...
  144. MatchStr 1 60 OK
  145. !    should xmit ATE0S36=4&Q5 for Express Modem
  146. Xmit ~HCMD\13
  147. Wait 300               ! wait up to 5 secs for a response
  148. IncVar 2            ! increment # modem setup tries
  149. IfVar 2 3 44        ! if 3 tries, display Modem Configuration Alert
  150. DsplyMsg Modem not responding to setup commands. Retrying...
  151. Pause 90
  152. Jump 42                ! else try modem setup again
  153. !
  154. !**********
  155. -LABEL 44    ! ---<Modem configuration err>---
  156. !**********
  157. Bell
  158. Alert 200 The modem is not responding to setup commands.\13Turn the modem off and then on again before retrying.
  159. SetVar 2 0            ! clear # modem setup tries
  160. Jump 40                ! reset modem and try again
  161. !
  162. !================================================================================
  163. -LABEL 60    !***<Modem ready>*** Dial phone
  164. !================================================================================
  165. DsplyMsg Dialing ~Fone...
  166. DsplyPic 2
  167. !    Look for one of the following expected responses
  168. MatchStr 1 80 ~GSTR
  169. MatchStr 2 80 PROTOCOL:LAP-M
  170. MatchStr 3 80 PROTOCOL:ALT
  171. MatchStr 4 62 ERROR
  172. MatchStr 5 66 NO CARRIER
  173. MatchStr 6 70 BUSY
  174. MatchStr 7 74 NO DIAL
  175. SetVar 2 0            ! clear #modem setup tries
  176. Flush
  177. Xmit ATD~Tone~Fone\13
  178. Wait 2400            ! wait up to 40 secs for a response
  179. !
  180. !**********
  181. -LABEL 62    !---<No response or ERROR from modem>---
  182. !**********
  183. IncVar 3            ! Increment # dial attempts counter
  184. IfVar 3 4 64        ! if 4 attempts, display No Dial Response Alert
  185. DsplyMsg Modem does not respond to Dial command. Retrying...
  186. Pause 90
  187. Jump 40                ! reset modem and try again
  188. !
  189. !**********
  190. -LABEL 64    !---<No dial response err>---
  191. !**********
  192. Bell
  193. Alert 200 The modem is not responding to dial command.\13Make sure your modem is connected to a phone line.
  194. SetVar 3 0            ! clear # dial attempts counter
  195. Jump 40                ! reset modem and try again
  196. !
  197. !**********
  198. -LABEL 66   !---<No Carrier>---
  199. !**********
  200. IncVar 3            ! Increment # dial attempts counter
  201. IfVar 3 4 68        ! if 4 attempts, display No Carrier Alert
  202. DsplyMsg No Carrier with phone number dialed. Retrying...
  203. Pause 90
  204. Jump 40                ! reset modem and try again
  205. !
  206. !**********
  207. -LABEL 68    !---<No carrier err>---
  208. !**********
  209. Bell
  210. Alert 200 Cannot detect carrier signal after dialing.\13Make sure the phone number provided is correct.
  211. SetVar 3 0            ! clear # dial attempts counter
  212. Jump 40                ! reset modem and try again
  213. !
  214. !**********
  215. -LABEL 70    !---<busy>---
  216. !**********
  217. IncVar 3            ! Increment # dial attempts counter
  218. IfVar 3 4 72        ! if 4 attempts, display Busy Alert
  219. DsplyMsg Phone number dialed is busy. Pausing before retrying...
  220. Wait 300            ! wait 5 secs
  221. DsplyMsg Retrying...
  222. Pause 90
  223. Jump 40                ! reset modem and try again
  224. !
  225. !**********
  226. -LABEL 72    !---<Busy err>---
  227. !**********
  228. Bell
  229. Alert 200 All network access lines are in use.\13Try again later.
  230. SetVar 3 0            ! clear # dial attempts counter
  231. Jump 40                ! reset modem and try again
  232. !
  233. !**********
  234. -LABEL 74    !---<No Dialtone>---
  235. !**********
  236. IncVar 3            ! Increment # dial attempts counter
  237. IfVar 3 4 76        ! if 4 attempts, display No Dialtone Alert
  238. DsplyMsg Modem reports no dial tone. Retrying...
  239. Pause 90
  240. Jump 40                ! reset modem and try again
  241. !
  242. !**********
  243. -LABEL 76   !---<No dialtone Error>---
  244. !**********
  245. Bell
  246. Alert 200 Modem reports no dial tone.\13Make sure your modem is connected to a phone line.
  247. SetVar 3 0            ! clear # dial attempts counter
  248. Jump 40                ! reset modem and try again
  249. !
  250. !================================================================================
  251. -LABEL 80    !***<Establish Physical Connection>*** Send H's to identify us to network
  252. !================================================================================
  253. DsplyMsg Requesting network attention...
  254. !    Look for one of the following expected responses
  255. MatchStr 1 84 NO CARRIER
  256. MatchStr 2 100 U#
  257. Xmit HH
  258. Wait 600            ! Allow 10 seconds for the U# to show up
  259. IncVar 3            ! No U#, increment # dial attempts counter
  260. IfVar 3 4 82        ! if 4 attempts, display No U# Alert
  261. Jump 80                ! else try again
  262. !
  263. !**********
  264. -LABEL 82    !---<No U#>---
  265. !**********
  266. Bell
  267. Alert 200 Unable to get the network's attention.\13Make sure you have the correct phone number.
  268. SetVar 3 0            ! clear # dial attempts counter
  269. Jump 40                ! reset modem and try again
  270. !
  271. !**********
  272. -LABEL 84    !---<Line dropped>---
  273. !**********
  274. IncVar 3            ! Increment # dial attempts counter
  275. IfVar 3 4 86        ! if 4 attempts, display Line Dropped Alert
  276. DsplyMsg Carrier signal dropped before network recognition. Retrying...
  277. Pause 90
  278. Jump 40                ! reset modem and try again
  279. !
  280. !**********
  281. -LABEL 86   !---<Line dropped Err>---
  282. !**********
  283. Bell
  284. Alert 200 Carrier signal dropped before network recognition.\13Try again.
  285. SetVar 3 0            ! clear # dial attempts counter
  286. Jump 40                ! reset modem and try again
  287. !
  288. !================================================================================
  289. -LABEL 100    !***<GEIS logon>***
  290. !================================================================================
  291. !
  292. DsplyMsg Physical Connection established. Logging on to network...
  293. DsplyPic 3
  294. SetVar 3 0            ! clear # dial attempts counter
  295. Wait 6                ! wait 0.1 sec
  296. Flush                ! clear input buffer
  297. !    Note: leave 2 spaces between ~Dist and ~Numb
  298. Xmit ~User,~Dist  ~Numb,~Ridn\13
  299. !
  300. !    Look for one of the following expected responses
  301. MatchStr 1 104 NO CARRIER
  302. MatchStr 2 106 DISCONNECTED
  303. MatchStr 3 120 ===>
  304. MatchStr 6 108 N FAULT,
  305. MatchStr 7 108 T FORMAT,
  306. MatchStr 8 110 L DENIED
  307. MatchStr 9 112 BUSY
  308. MatchStr 10 112 DOWN
  309. Wait 600            ! wait up to 10 seconds for a response
  310. IncVar 4            ! Increment # logon attempts counter
  311. IfVar 4 3 102        ! if 3 tries, display No Login Response alert 
  312. DsplyMsg No logon response from network. Retrying...
  313. Pause 90
  314. Jump 100            ! try again
  315. !
  316. !*********
  317. -LABEL 102    !---<No Logon response>---
  318. !*********
  319. Bell
  320. Alert 200 No logon response from network.\13Try again.
  321. SetVar 4 0            ! clear # logon attempts counter
  322. Jump 40                ! reset modem and try again
  323. !
  324. !*********
  325. -LABEL 104    !---<Carrier dropped>---
  326. !*********
  327. IncVar 4            ! Increment # login attempts counter
  328. IfVar 4 3 105        ! if 3 attempts, display Carrier dropped alert
  329. DsplyMsg Carrier signal dropped during network logon. Retrying...
  330. Pause 90
  331. Jump 40                ! reset modem and try again
  332. !
  333. !*********
  334. -LABEL 105    !---<Carrier dropped Err>---
  335. !*********
  336. Bell
  337. Alert 200 Carrier signal dropped during network logon.\13Try again.
  338. SetVar 4 0            ! clear # logon attempts counter
  339. Jump 40                ! reset modem and try again
  340. !
  341. !*********
  342. -LABEL 106    !---<Session disconnected>---
  343. !*********
  344. IncVar 4            ! Increment # logon attempts counter
  345. IfVar 4 3 107        ! if 3 attempts, display Session disconnected alert
  346. DsplyMsg Network connection dropped during network logon. Retrying...
  347. Pause 90
  348. Jump 40                ! reset modem and try again
  349. !
  350. !*********
  351. -LABEL 107    !---<Session disconnected Err>---
  352. !*********
  353. Bell
  354. Alert 200 Network connection dropped during network logon.\13Try again.
  355. SetVar 4 0            ! clear # logon attempts counter
  356. Jump 40                ! reset modem and try again
  357. !
  358. !*********
  359. -LABEL 108    !---<Validation fault>---
  360. !*********
  361. IncVar 4            ! Increment # logon attempts counter
  362. IfVar 4 3 109        ! see if limit of 3 is exceeded.
  363. DsplyMsg Network rejected your identification. Retrying...
  364. Pause 90
  365. Jump 100            ! retry GEIS login (only case where we don't reset)
  366. !
  367. !*********
  368. -LABEL 109    !---<validation fault err>---
  369. !*********
  370. Bell
  371. Alert 200 Your network identification has been rejected.\13Check Setup to make sure your identification is correct.
  372. SetVar 4 0            ! clear # logon attempts counter
  373. Jump 40                ! reset modem and try again
  374. !
  375. !*********
  376. -LABEL 110    !---<Denied by host>---
  377. !*********
  378. IncVar 4            ! Increment # logon attempts counter
  379. IfVar 4 3 111        ! if 3 attempts, display Network Problem alert
  380. DsplyMsg Network host equipment problem detected. Retrying...
  381. Pause 90
  382. Jump 40                ! reset modem and try again
  383. !
  384. !*********
  385. -LABEL 111    !---<Denied by host err>---
  386. !*********
  387. Bell
  388. Alert 200 Network host equipment problem detected.\13Try again.
  389. SetVar 4 0            ! clear # logon attempts counter
  390. Jump 40                ! reset modem and try again
  391. !
  392. !*********
  393. -LABEL 112    !---<MARK3K access busy/down>---
  394. !*********
  395. IncVar 4            ! Increment # logon attempts counter
  396. IfVar 4 3 113        ! if 3 attempts, display Network Busy alert
  397. DsplyMsg Network equipment busy/down. Retrying...
  398. Pause 90
  399. Jump 40                ! reset modem and try again
  400. !
  401. !*********
  402. -LABEL 113    !---<MARK3K access busy/down err>---
  403. !*********
  404. Bell
  405. Alert 200 Network equipment busy or down.\13Try again.
  406. SetVar 4 0            ! clear # logon attempts counter
  407. Jump 40                ! reset modem and try again
  408. !
  409. !================================================================================
  410. -LABEL 120    !***<MARK3000 prompt>*** Invoke CICS
  411. !================================================================================
  412. !
  413. DsplyMsg Requesting access to network subsystem...
  414. DsplyPic 4
  415. Wait 6                ! wait 0.1 secs
  416. Flush                ! clear input buffer
  417. !
  418. Xmit ~CICS\13
  419. !    Look for one of the following expected responses
  420. MatchStr 3 140 READY
  421. !    To overcome a network problem, the following label was changed from 124 to 126
  422. !    MatchStr 4 124 T BOUND
  423. MatchStr 4 126 T BOUND
  424. MatchStr 5 126 UNRECOGN
  425. MatchStr 6 126 ===>
  426. Wait 3600            ! Allow 60 secs for the expected responses to show up
  427. IncVar 5            ! Timeout, so increment # CICS tries counter
  428. IfVar 5 2 122        ! if 3 tries, display No Response alert
  429. DsplyMsg No response to network subsystem request. Retrying...
  430. Pause 90
  431. Jump 40                ! reset modem and try again
  432. !
  433. !*********
  434. -LABEL 122    !---<No CICS err>---
  435. !*********
  436. Bell
  437. Alert 200 No response to network subsystem request.\13Try again.
  438. SetVar 5 0            ! clear # CICS tries counter
  439. Jump 40                ! reset modem and try again
  440. !
  441. !*********
  442. -LABEL 124    !---<Session not bound err>---
  443. !*********
  444. Bell
  445. Alert 200 Network CICS subsystem needs to be started.\13Please contact the Apple USA helpline immediately.
  446. Jump 200            ! jump to cancel routine
  447. !
  448. !*********
  449. -LABEL 126    !---<Invalid application>---
  450. !*********
  451. IncVar 5            ! Increment # CICS tries counter
  452. IfVar 5 3 127        ! if 3 tries, display Invalid Application alert
  453. DsplyMsg Network subsystem request has been rejected. Retrying...
  454. Pause 90
  455. Flush
  456. Jump 120            ! try to access CICS again
  457. !
  458. !*********
  459. -LABEL 127    !---<Invalid application err>---
  460. !*********
  461. Bell
  462. Alert 200 The network subsystem request has been rejected.\13Try again.
  463. SetVar 5 0            ! clear # CICS tries counter
  464. Flush
  465. Jump 40                ! reset modem and try again
  466. !
  467. !================================================================================
  468. -LABEL 140    !***<CICS ready>*** Start APPM transaction
  469. !================================================================================
  470. !
  471. DsplyMsg Requesting access to distribution center ~Dist...
  472. DsplyPic 5            ! Highlight box 5 on screen
  473. SetVar 5 0            ! clear # CICS tries counter
  474. !                    ! Send what needs to be sent
  475. Xmit ~Epgm~Dist\13
  476. !    Look for one of the following expected responses
  477. Wait 12                ! wait 0.2 secs
  478. Flush                ! clear input buffer
  479. !    Look for one of the following expected responses
  480. MatchStr 3 160 C100
  481. MatchStr 4 144 INVALID
  482. Wait 3600            ! Allow 60 secs for the expected responses to show up
  483. !
  484. IncVar 6            ! Timeout, so Increment # APPM tries counter
  485. IfVar 6 2 142        ! if 2 tries, display No Transaction alert
  486. DsplyMsg No response to distribution center access request. Retrying...
  487. Pause 90
  488. Jump 40                ! reset modem and try again
  489. !
  490. !*********
  491. -LABEL 142    !---<No transaction response>---
  492. !*********
  493. Bell
  494. Alert 200 No response to distribution center access.\13Try again.
  495. SetVar 6 0            ! reset # APPM tries counter
  496. Jump 40                ! reset modem and try again
  497. !
  498. !*********
  499. -LABEL 144    !---<Invalid transaction>---
  500. !*********
  501. IncVar 6            ! Increment # APPM tries counter
  502. IfVar 6 2 145        ! if 2 tries, display Invalid Transaction alert
  503. DsplyMsg Distribution center access request rejected. Retrying...
  504. Pause 90
  505. Jump 40                ! reset modem and try again
  506. !
  507. !*********
  508. -LABEL 145    !---<Invalid transaction err>---
  509. !*********
  510. Bell
  511. Alert 200 Distribution center access request rejected.\13Check Setup to make sure your identification is correct.
  512. SetVar 6 0            ! reset # APPM tries counter
  513. Jump 40                ! reset modem and try again
  514. !
  515. !================================================================================
  516. -LABEL 160    !***<Online>***
  517. !================================================================================
  518. !
  519. Wait 60                ! wait 1 sec
  520. DsplyMsg Accessing the distribution center ~Dist...
  521. DsplyPic 6            ! Highlight box 6 on screen
  522. !    C9 = pass msg thru GE, 899 = Echo cmd
  523. Xmit C9899Ole\13
  524. !    Look for one of the following expected responses
  525. MatchStr 2 162 C5
  526. MatchStr 3 170 Ole\13
  527. Wait 7200            ! wait 2 minutes for echo back or distribution center nonavail msg
  528. !
  529. !*********
  530. -LABEL 162    !---<no luck this time>--- 
  531. !*********
  532. DsplyMsg Distribution center is not available...
  533. Pause 90
  534. Jsr 180                ! terminate session
  535. Bell
  536. Alert -1 Distribution center is not available.\13Please try again later.
  537. Jump 200            ! exit to Cancel routine
  538. !
  539. !*********
  540. -LABEL 170    !---<Success, we’re in, so exit>--- 
  541. !*********
  542. Wait 30                ! wait 0.5 secs
  543. Flush                ! clear input buffer
  544. Exit 0                ! exit the script normally
  545. !
  546. !================================================================================
  547. -LABEL 180-199    !***<Terminate Session>***
  548. !================================================================================
  549. !
  550. !*********
  551. -LABEL 180    !---<Terminate session>--- 
  552. !*********
  553. !    send Abnormal disconnect command
  554. Xmit C3\13
  555. !    Look for one of the following expected responses
  556. MatchStr 1 182 U#
  557. Wait 300            ! wait 5 secs
  558. Return
  559. !
  560. !*********
  561. -LABEL 182    !---<Say bye>---
  562. !*********
  563. Wait 6                ! wait 0.1 sec and sign off the network
  564. Xmit BYE\13
  565. Return
  566. !
  567. !================================================================================
  568. -LABEL 200    !***<Cancel Routine>***
  569. !================================================================================
  570. DsplyMsg Cancelling...
  571. Flush
  572. Wait 30                ! wait 0.5 secs
  573. Exit -1                ! exit the script with an error
  574. !
  575. !================================================================================
  576. -LABEL 210    !***<Hang up phone Routine>***
  577. !================================================================================
  578. SetVar 1 0            ! clear # hangup tries counter
  579. SetVar 2 0            ! clear # modem config tries counter
  580. MatchStr 1 212 OK
  581. MatchStr 2 212 NO CARRIER
  582. ChrDelay 0
  583. !
  584. !*********
  585. -LABEL 211
  586. !*********
  587. Pause 80
  588. Xmit +++
  589. Pause 80
  590. Flush
  591. Xmit AT\13
  592. Wait 300
  593. IncVar 1
  594. IfVar 1 2 213
  595. Jump 211
  596. !
  597. !*********
  598. -LABEL 212
  599. !*********
  600. MatchStr 1 214 OK
  601. Xmit ATH\13
  602. Wait 300
  603. !
  604. !**********
  605. -LABEL 213    ! ---<Modem Hangup err>---
  606. !**********
  607. Bell
  608. Alert 200 The modem is not responding to the hangup command.\13Turn the modem off and then on again before retrying.
  609. SetVar 1 0
  610. SetVar 2 0
  611. Jump 40                ! reset modem and try again
  612. !
  613. !*********
  614. -LABEL 214
  615. !*********
  616. Return
  617. !
  618. !================================================================================
  619. -LABEL 230-239    !***<UNUSED>***
  620. !================================================================================
  621. !
  622. !================================================================================
  623. -LABEL 240    !***<Disconnection Sequence>***
  624. !================================================================================
  625. !
  626. !    If the connection is closed, we cant hangup, so just exit
  627. !    CTBIFCLOSED <LabelToGotoIfConnectionClosed>
  628. CTBIFCLOSED 246
  629. !
  630. SetVar 7 1            ! We're disconnecting, so set the flag
  631. !    Look for one of the following expected responses
  632. MatchStr 1 242 U#
  633. MatchStr 2 244 NO CARRIER
  634. Wait 60                ! wait 1 sec
  635. Jump 244            ! and hang up the phone
  636. !
  637. !*********
  638. -LABEL 242    !---<Sign off the network>---
  639. !*********
  640. Xmit BYE\13
  641. Wait 120            ! wait 2 secs
  642. !
  643. !*********
  644. -LABEL 244    !---<Hang up the phone>---
  645. !*********
  646. SetVar 1 0            ! clear the # hangup tries counter
  647. Jsr 210                ! Execute the Hang-up subroutine
  648. !    No CTBClose here because the connection is closed externally from the script
  649. !    in case we exited the script with an error before completion.
  650. Flush                ! clear input buffer
  651. Exit 0                ! exit the script normally
  652. !
  653. !*********
  654. -LABEL 246    !---<Connection Was Closed>---
  655. !*********
  656. Flush                ! clear input buffer
  657. Exit 0                ! exit the script normally
  658. ###
  659.